import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";
import { permission } from "./permission";
import {
  HomeRouteComponent,
  LoginRouteComponent,
  PayRouteComponent,
  RootRouteComponent,
  overviewRouteComponent,
} from "./basics.router";
export const constantRouterMap: any = [
  RootRouteComponent,
  // HomeRouteComponent,
  overviewRouteComponent,
  LoginRouteComponent,
  PayRouteComponent,
  {
    path: "/:pathMatch(.*)*",
    name: "404",
    component: () => import("@/views/403"),
  },
];
export const mode =
  isDevEnv.value || isBuildTest.value
    ? createWebHashHistory()
    : createWebHistory();
const router = createRouter({
  history: mode,
  routes: constantRouterMap,
});
permission(router);
export default router;
